import { useEffect } from "react";

function App() {
  useEffect(() => {
    (async () => {
      const result = await getDate();
      console.log(result);
    })();
  });
  return <div>App</div>;
}

// 模拟异步操作
function getDate() {
  return new Promise((resolve) => {
    resolve({ msg: "Hello Yun" });
  });
}
export default App;
